<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" deferredSyntaxAllowedAsLiteral="true" %>

<%--
  Created by IntelliJ IDEA.
  User: Jane
  Date: 2023/3/10
  Time: 14:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<script src="js/jquery1.42.min.js"></script>

<form>
    姓名 <input type="text" name="name" id="name"><br/>
    性别 <input type="radio" name="sex" id="man">男 <input type="radio" name="sex" id="woman">女<br/>
    email <input type="text" name="email" id="email"><br/>
    所属仓库 <input type="text" name="warehouse_id" id="warehouse_id"><br/>
    <input type="button" id="saveBtn" value="确认修改">
</form>

<script>
    $("#saveBtn").click(function () {
        $.ajax({
            url: "modifyDriver.do",
            type: "GET",
            data: {
                name: $("#name").val(),
                sex: $("#sex").val(),
                email: $("#email").val(),
                warehouse_id: $("#warehouse_id").val(),
            },
            dataType: "json",
            success: function (data) {
                alert(data);
                if (data.code == "1") {
                    window.location.reload()
                }
            }
        });
    });
</script>


</body>
</html>
